//
//  OrderM.m
//  同盟圈
//
//  Created by 洛水寒 on 16/4/19.
//  Copyright © 2016年 ym. All rights reserved.
//

#import "OrderM.h"

@implementation OrderM

@synthesize order_id;   
@synthesize channel;
@synthesize shop_id;
@synthesize shop_name;
@synthesize real_amount;


- (id)initWithOrderDict:(NSDictionary *)dict///
{
    if ((self = [super init])) {
//        if (isKindOfNSDictionary(dict)) {
//            self.order_id = [dict stringValueForKey:@"order_id"];
//            self.real_amount = [dict floatValueForKey:@"real_amount"];
//            self.order_state = [dict intValueForKey:@"order_state"];
//            self.evaluation_state = [dict intValueForKey:@"evaluation_state"];
//            self.refund_state = [dict intValueForKey:@"refund_state"];
//            
//            self.distribution_status = [dict intValueForKey:@"distribution_status"];
//            self.pay_amount = [dict floatValueForKey:@"pay_amount"];
//            self.comment_status = [dict intValueForKey:@"comment_status"];
//            
//            self.shop_id = [dict stringValueForKey:@"shop_id"];
//            self.shop_name = [dict stringValueForKey:@"shop_name"];
//            self.channel = [dict stringValueForKey:@"channel"];
//            self.channel_name = [dict stringValueForKey:@"channel_name"];
//            
//            self.province_code = [dict stringValueForKey:@"province_code"];
//            self.area_code = [dict stringValueForKey:@"area_code"];
//            self.city_code = [dict stringValueForKey:@"city_code"];
//            self.mobile = [dict stringValueForKey:@"mobile"];
//            
//            self.amount = [dict floatValueForKey:@"amount"];
//            
//            self.pay_status  = [dict intValueForKey:@"pay_status"];
//            self.refund = [dict intValueForKey:@"refund"];
//            self.status = [dict intValueForKey:@"status"];
//            self.delivery = [dict intValueForKey:@"delivery"];
//            self.self_send = [dict intValueForKey:@"self_send"];
//            
//            self.isDiscount = [dict stringValueForKey:@"isDiscount"];
//            if (isKindOfNSArray([dict objectForKey:@"goods_list"]))
//            {
//                NSArray *array = [dict objectForKey:@"goods_list"];
//                if (array.count) {
//                    if (isKindOfNSDictionary([array objectAtIndex:0])) {
//                        NSDictionary *goodDic = [array objectAtIndex:0];
//                        self.goodsName = [goodDic stringValueForKey:@"product_name"];
//                    }
//                }
//            }
        
            //  Goods *obj = [[Goods alloc] initWithOrderDict:dict];
            //            self.goods = obj;
            //            [obj release];
       // }
    }
    return self;
}

//// 待付款
//- (BOOL)ispending
//{
//    return (self.order_type == 1) ? YES : NO;
//}
//
//// 已付款
//- (BOOL)ispaid
//{
//    return (self.order_type == 2) ? YES : NO;
//}
//
//// 完成订单
//- (BOOL)iscomplete
//{
//    return (self.order_type == 3) ? YES : NO;
//}

// 待付款
- (BOOL)ispending
{
    return (self.order_type == 1) ? YES : NO;
}

// 待发货 Shipping
- (BOOL)Shipping
{
    return (self.order_type == 2) ? YES : NO;
}

// 待收货 received
- (BOOL)received
{
    return (self.order_type == 3) ? YES : NO;
}
//evaluate 评价
- (BOOL)evaluate
{
    return (self.order_type == 4) ? YES : NO;
}

//refund退款
- (BOOL)refunding
{
    return (self.order_type == 5) ? YES : NO;
}

@end
